package com.eshop.service.Impl;

import com.eshop.dao.CategoryDao;
import com.eshop.dao.GoodsDao;
import com.eshop.dao.Impl.CategoryDaoImpl;
import com.eshop.dao.Impl.GoodsDaoImpl;
import com.eshop.dao.Impl.PicDaoImpl;
import com.eshop.dao.PicDao;
import com.eshop.model.Goods;
import com.eshop.model.Pic;
import com.eshop.service.GoodsDetailService;

import java.util.List;

public class GoodsDetailServiceImpl implements GoodsDetailService {
    CategoryDao categoryDao = new CategoryDaoImpl();
    GoodsDao goodsDao = new GoodsDaoImpl();
    PicDao picDao = new PicDaoImpl();

    @Override
    public Goods getGoodsById(int id) {
        return  goodsDao.queryGoodsById(id);
    }

    @Override
    public List<Pic> getPicListByGoodsId(int id) {
        return picDao.queryPicByGoodsId(id);
    }

    @Override
    public String getParentNameByCateId(int id) {
        return categoryDao.queryCategoryByCateId(id).getCate_name();
    }
}
